﻿using Itech_Run.Domain.Shared.Localization.Back;
using Microsoft.Extensions.Caching.StackExchangeRedis;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
using Volo.Abp.VirtualFileSystem;

namespace Itech_Run.Domain.Shared
{
    [DependsOn(typeof(Volo.Abp.Localization.AbpLocalizationModule)
        , typeof(Volo.Abp.Domain.AbpDddDomainModule)
        , typeof(Volo.Abp.Caching.AbpCachingModule)
        , typeof(Volo.Abp.Caching.StackExchangeRedis.AbpCachingStackExchangeRedisModule)//采用Redis缓存
        )]
    public class Itech_RunDomainSharedModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            Configure<AbpVirtualFileSystemOptions>(options =>
            {
                options.FileSets.AddEmbedded<Itech_RunDomainSharedModule>("Itech_Run.Domain.Shared");
            });

            Configure<AbpLocalizationOptions>(options =>
            {
                options.Resources
                    .Add<BackResource>("zh-Hans")
                    .AddVirtualJson("/Localization/Back/langs");

                options.DefaultResourceType = typeof(BackResource);
            });

            Configure<RedisCacheOptions>(options =>
            {

            });

            //全局工作单元选项
            Configure<AbpUnitOfWorkDefaultOptions>(options =>
            {
                //options.IsolationLevel = System.Data.IsolationLevel.ReadUncommitted;
            });
        }
    }
}